package com.liuyh.demo.serviceconsumer.controller;

import com.liuyh.demo.serviceconsumer.service.ComputeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/compute")
public class ComputeController {

    @Autowired
    ComputeService computeService;

    @PostMapping("/add")
    public @ResponseBody int add(int a,int b){
        return computeService.addService(a,b);
    }

    @PostMapping("/decrease")
    public @ResponseBody int decrease(int a,int b){
        return computeService.decreaseService(a,b);
    }
}
